package com.klw.business.service.impl;

import java.util.List;
import com.klw.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.klw.business.mapper.KlwMajorMapper;
import com.klw.business.domain.KlwMajor;
import com.klw.business.service.IKlwMajorService;

/**
 * 专业Service业务层处理
 * 
 * @author klw
 * @date 2025-08-24
 */
@Service
public class KlwMajorServiceImpl implements IKlwMajorService 
{
    @Autowired
    private KlwMajorMapper klwMajorMapper;

    /**
     * 查询专业
     * 
     * @param majorId 专业主键
     * @return 专业
     */
    @Override
    public KlwMajor selectKlwMajorByMajorId(Long majorId)
    {
        return klwMajorMapper.selectKlwMajorByMajorId(majorId);
    }

    /**
     * 查询专业列表
     * 
     * @param klwMajor 专业
     * @return 专业
     */
    @Override
    public List<KlwMajor> selectKlwMajorList(KlwMajor klwMajor)
    {
        return klwMajorMapper.selectKlwMajorList(klwMajor);
    }

    /**
     * 新增专业
     * 
     * @param klwMajor 专业
     * @return 结果
     */
    @Override
    public int insertKlwMajor(KlwMajor klwMajor)
    {
        klwMajor.setCreateTime(DateUtils.getNowDate());
        return klwMajorMapper.insertKlwMajor(klwMajor);
    }

    /**
     * 修改专业
     * 
     * @param klwMajor 专业
     * @return 结果
     */
    @Override
    public int updateKlwMajor(KlwMajor klwMajor)
    {
        klwMajor.setUpdateTime(DateUtils.getNowDate());
        return klwMajorMapper.updateKlwMajor(klwMajor);
    }

    /**
     * 批量删除专业
     * 
     * @param majorIds 需要删除的专业主键
     * @return 结果
     */
    @Override
    public int deleteKlwMajorByMajorIds(Long[] majorIds)
    {
        return klwMajorMapper.deleteKlwMajorByMajorIds(majorIds);
    }

    /**
     * 删除专业信息
     * 
     * @param majorId 专业主键
     * @return 结果
     */
    @Override
    public int deleteKlwMajorByMajorId(Long majorId)
    {
        return klwMajorMapper.deleteKlwMajorByMajorId(majorId);
    }
}
